package com.zhonghui.modlules.user.eshopDomain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eshop.domain.BaseDomain;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@TableName("system_user_level")
public class SystemUserLevel extends BaseDomain {
    @TableId
    private Integer id;
    private Integer merId;
    @NotBlank(
            message = "名称必填"
    )
    private String name;
    private BigDecimal money;
    private Integer validDate;
    private Integer isForever;
    private Integer isPay;
    private Integer isShow;
    @NotNull(
            message = "请输入会员等级"
    )
    private Integer grade;
    @NotNull(
            message = "请输入会员折扣"
    )
    private BigDecimal discount;
    @NotBlank(
            message = "请上传会员背景"
    )
    private String image;
    @NotBlank(
            message = "请上传会员图标"
    )
    private String icon;
    @TableField("`explain`")
    private String explain;

    public void copy(SystemUserLevel source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public SystemUserLevel() {
    }

    public Integer getId() {
        return this.id;
    }

    public Integer getMerId() {
        return this.merId;
    }

    public String getName() {
        return this.name;
    }

    public BigDecimal getMoney() {
        return this.money;
    }

    public Integer getValidDate() {
        return this.validDate;
    }

    public Integer getIsForever() {
        return this.isForever;
    }

    public Integer getIsPay() {
        return this.isPay;
    }

    public Integer getIsShow() {
        return this.isShow;
    }

    public Integer getGrade() {
        return this.grade;
    }

    public BigDecimal getDiscount() {
        return this.discount;
    }

    public String getImage() {
        return this.image;
    }

    public String getIcon() {
        return this.icon;
    }

    public String getExplain() {
        return this.explain;
    }

    public void setId(final Integer id) {
        this.id = id;
    }

    public void setMerId(final Integer merId) {
        this.merId = merId;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public void setMoney(final BigDecimal money) {
        this.money = money;
    }

    public void setValidDate(final Integer validDate) {
        this.validDate = validDate;
    }

    public void setIsForever(final Integer isForever) {
        this.isForever = isForever;
    }

    public void setIsPay(final Integer isPay) {
        this.isPay = isPay;
    }

    public void setIsShow(final Integer isShow) {
        this.isShow = isShow;
    }

    public void setGrade(final Integer grade) {
        this.grade = grade;
    }

    public void setDiscount(final BigDecimal discount) {
        this.discount = discount;
    }

    public void setImage(final String image) {
        this.image = image;
    }

    public void setIcon(final String icon) {
        this.icon = icon;
    }

    public void setExplain(final String explain) {
        this.explain = explain;
    }

    public String toString() {
        return "SystemUserLevel(id=" + this.getId() + ", merId=" + this.getMerId() + ", name=" + this.getName() + ", money=" + this.getMoney() + ", validDate=" + this.getValidDate() + ", isForever=" + this.getIsForever() + ", isPay=" + this.getIsPay() + ", isShow=" + this.getIsShow() + ", grade=" + this.getGrade() + ", discount=" + this.getDiscount() + ", image=" + this.getImage() + ", icon=" + this.getIcon() + ", explain=" + this.getExplain() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof SystemUserLevel)) {
            return false;
        } else {
            SystemUserLevel other = (SystemUserLevel)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (!super.equals(o)) {
                return false;
            } else {
                label169: {
                    Object this$id = this.getId();
                    Object other$id = other.getId();
                    if (this$id == null) {
                        if (other$id == null) {
                            break label169;
                        }
                    } else if (this$id.equals(other$id)) {
                        break label169;
                    }

                    return false;
                }

                Object this$merId = this.getMerId();
                Object other$merId = other.getMerId();
                if (this$merId == null) {
                    if (other$merId != null) {
                        return false;
                    }
                } else if (!this$merId.equals(other$merId)) {
                    return false;
                }

                label155: {
                    Object this$validDate = this.getValidDate();
                    Object other$validDate = other.getValidDate();
                    if (this$validDate == null) {
                        if (other$validDate == null) {
                            break label155;
                        }
                    } else if (this$validDate.equals(other$validDate)) {
                        break label155;
                    }

                    return false;
                }

                Object this$isForever = this.getIsForever();
                Object other$isForever = other.getIsForever();
                if (this$isForever == null) {
                    if (other$isForever != null) {
                        return false;
                    }
                } else if (!this$isForever.equals(other$isForever)) {
                    return false;
                }

                Object this$isPay = this.getIsPay();
                Object other$isPay = other.getIsPay();
                if (this$isPay == null) {
                    if (other$isPay != null) {
                        return false;
                    }
                } else if (!this$isPay.equals(other$isPay)) {
                    return false;
                }

                label134: {
                    Object this$isShow = this.getIsShow();
                    Object other$isShow = other.getIsShow();
                    if (this$isShow == null) {
                        if (other$isShow == null) {
                            break label134;
                        }
                    } else if (this$isShow.equals(other$isShow)) {
                        break label134;
                    }

                    return false;
                }

                label127: {
                    Object this$grade = this.getGrade();
                    Object other$grade = other.getGrade();
                    if (this$grade == null) {
                        if (other$grade == null) {
                            break label127;
                        }
                    } else if (this$grade.equals(other$grade)) {
                        break label127;
                    }

                    return false;
                }

                Object this$name = this.getName();
                Object other$name = other.getName();
                if (this$name == null) {
                    if (other$name != null) {
                        return false;
                    }
                } else if (!this$name.equals(other$name)) {
                    return false;
                }

                Object this$money = this.getMoney();
                Object other$money = other.getMoney();
                if (this$money == null) {
                    if (other$money != null) {
                        return false;
                    }
                } else if (!this$money.equals(other$money)) {
                    return false;
                }

                label106: {
                    Object this$discount = this.getDiscount();
                    Object other$discount = other.getDiscount();
                    if (this$discount == null) {
                        if (other$discount == null) {
                            break label106;
                        }
                    } else if (this$discount.equals(other$discount)) {
                        break label106;
                    }

                    return false;
                }

                label99: {
                    Object this$image = this.getImage();
                    Object other$image = other.getImage();
                    if (this$image == null) {
                        if (other$image == null) {
                            break label99;
                        }
                    } else if (this$image.equals(other$image)) {
                        break label99;
                    }

                    return false;
                }

                Object this$icon = this.getIcon();
                Object other$icon = other.getIcon();
                if (this$icon == null) {
                    if (other$icon != null) {
                        return false;
                    }
                } else if (!this$icon.equals(other$icon)) {
                    return false;
                }

                Object this$explain = this.getExplain();
                Object other$explain = other.getExplain();
                if (this$explain == null) {
                    if (other$explain != null) {
                        return false;
                    }
                } else if (!this$explain.equals(other$explain)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof SystemUserLevel;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = super.hashCode();
        Object $id = this.getId();
        result = result * 59 + ($id == null ? 43 : $id.hashCode());
        Object $merId = this.getMerId();
        result = result * 59 + ($merId == null ? 43 : $merId.hashCode());
        Object $validDate = this.getValidDate();
        result = result * 59 + ($validDate == null ? 43 : $validDate.hashCode());
        Object $isForever = this.getIsForever();
        result = result * 59 + ($isForever == null ? 43 : $isForever.hashCode());
        Object $isPay = this.getIsPay();
        result = result * 59 + ($isPay == null ? 43 : $isPay.hashCode());
        Object $isShow = this.getIsShow();
        result = result * 59 + ($isShow == null ? 43 : $isShow.hashCode());
        Object $grade = this.getGrade();
        result = result * 59 + ($grade == null ? 43 : $grade.hashCode());
        Object $name = this.getName();
        result = result * 59 + ($name == null ? 43 : $name.hashCode());
        Object $money = this.getMoney();
        result = result * 59 + ($money == null ? 43 : $money.hashCode());
        Object $discount = this.getDiscount();
        result = result * 59 + ($discount == null ? 43 : $discount.hashCode());
        Object $image = this.getImage();
        result = result * 59 + ($image == null ? 43 : $image.hashCode());
        Object $icon = this.getIcon();
        result = result * 59 + ($icon == null ? 43 : $icon.hashCode());
        Object $explain = this.getExplain();
        result = result * 59 + ($explain == null ? 43 : $explain.hashCode());
        return result;
    }
}

